/*
 * @Author: zlanglang
 * @Date: 2020-07-023 19:31:53
 * @LastEditTime: 2020-07-23 19:32:00
 * @LastEditors: zxc
 * @Description: webpack扩展，基于customize-cra库
 */ 
const {
  override,
  fixBabelImports,
  addLessLoader,
} = require('customize-cra');

module.exports = override(
  fixBabelImports('import', {
    libraryName: 'antd',
    libraryDirectory: 'es',
    // style 的选项 ‘css' 表示引入的css文件   true 表示引入的less
    style: true,
  }),
  // 这里设置less
  // 同时是定制ant-design的主题
  // ant-design 定制主题变量： https://ant.design/docs/react/customize-theme-cn
  addLessLoader({
    javascriptEnabled: true,
    modifyVars: {
      '@primary-color': '#d214a2',
      '@font-size-base': '12px',
    }
  }),
);